const Koa = require('koa')
const bodyParser = require('koa-bodyparser')
const log=require("../log")
const registerRouters=require("../router/index")
// const logger=require("../utils/log")

// const  userRouter  = require('../router/user.router')
// const  loginRouter  = require('../router/login.router')
// 创建app
const app = new Koa()
// 对app使用中间件
app.use(log)
// app.use(logger)
app.use(bodyParser())
registerRouters(app)
// app.use(userRouter.routes())
// app.use(userRouter.allowedMethods())
// app.use(loginRouter.routes())
// app.use(loginRouter.allowedMethods())
// 导出app
module.exports = app
